/* 
============
js/script.js
============
date		: 04 Juli 2014
by 			: Panembahan Satyapradana
site		: www.klikedukasi.com
description : javascript modal dialog sederhana
*/

window.onload = function(){ 

	var pencetan = document.getElementById('tombols');
	var lapisan = document.getElementById('selimut');
	var keluar = document.getElementById('kembali');
	var content = document.getElementById('isi');

	pencetan.addEventListener('click', ubahStyle, false);
	keluar.addEventListener('click', kembalikan, false);

	function ubahStyle() {
		lapisan.style.visibility = 'visible';
		lapisan.style.background = 'rgba(39, 40, 34, 0.5)';
		lapisan.style.transition = 'all 0.5s';
		content.style.transition = 'all 1s';
		content.style.top = '0';
}

	function kembalikan() {
		lapisan.style.visibility = "hidden";
		lapisan.style.background = 'rgba(39, 40, 34, 0)';
		lapisan.style.transition = 'all 1.5s';
		content.style.transition = 'all 1s';	
		content.style.top = '-999';		
	}

}